home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_commiecreator.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  266 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_CommieCreator.cog
  4. #
  5. # Creates a bunch of enemies after various events in the waterworks
  6. #
  7. # [CM]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     #    MESSAGES
  15.     message     startup
  16.     message     crossed
  17.     message     user0
  18.     
  19.     #    COGS
  20.     cog     thawcog
  21.     cog     keycog
  22.     cog     gatecog
  23.  
  24.     #    TRIGGERS
  25.     surface        triggersurf
  26.     surface        triggersurf1
  27.  
  28.     #    PROPS
  29.     thing        door0
  30.     thing        door1
  31.     sector        doorsector    local
  32.  
  33.     #    ACTORS
  34.     thing        player          local
  35.     
  36.     thing        enemy0          
  37.     thing        enemy1          
  38.     thing        enemy2          
  39.     thing        enemy3          
  40.     thing        enemy4          
  41.     thing        enemy5          
  42.     thing        enemy6
  43.  
  44.     #    ACTOR MARKS
  45.     thing        enemy_mv0
  46.     thing        enemy_mv1
  47.     thing        enemy_mv2
  48.     thing        enemy_mv3
  49.     thing        enemy_mv4
  50.     
  51.     #    SOUNDS
  52.     sound        dangercue1=mus_gen_russbold_shrt4.wav    local
  53.     sound        dangercue2=mus_gen_russbold_shrt3.wav    local
  54.     sound        dangercue3=mus_gen_russbold_shrt1.wav    local
  55.     
  56.     #    VARIABLES
  57.     int         enemytype       local
  58.     int         crosonce=0      local
  59.     int         thawevent=0     local
  60.     int         key2event=0     local
  61.     int         gateevent=0     local
  62.     int         i=0             local
  63.     
  64.     
  65.  
  66. end
  67.  
  68. # ========================================================================================
  69.  
  70. code
  71.  
  72. startup:
  73.     
  74.     doorSector = GetThingSector(door0);
  75.     SetSectorAdjoins(doorSector, 0);
  76.     crosonce = 0;
  77.     player = GetLocalPlayerThing();
  78.     
  79.     for (i = 0; i <= 6; i = i + 1)
  80.         {
  81.         SetThingFlags(enemy0[i], 0x80000);
  82.         AISetCutSceneMode(enemy0[i]);
  83.         }
  84. return;
  85.     
  86.  
  87. # ........................................................................................
  88. crossed:
  89.     If (crosonce == 3) return;
  90.         
  91.         If ((GetSenderRef() == triggersurf) && (GetSourceRef() == player))
  92.                {
  93.                 If (thawevent == 1)  
  94.                    {
  95.                    call guard;
  96.                    thawevent = 2;
  97.                    return;
  98.                    }
  99.            else If  (gateevent == 1)
  100.                    {
  101.                    call guard;
  102.                    gateevent = 2;
  103.                    return;
  104.                    }
  105.                }    
  106.         
  107.         If ((GetSenderRef() == triggersurf1) && (GetSourceRef() == player) && (keyevent == 1))
  108.                 {
  109.                 call guard;
  110.                 keyevent = 2;
  111.                 return;
  112.                 }
  113. return;
  114.     
  115. # ........................................................................................
  116. user0:
  117.  
  118.         If (GetSenderRef() == thawcog)
  119.                 {
  120.                 print("message from river received");
  121.                 thawevent= 1;
  122.                 }
  123.                 
  124.         If (GetSenderRef() == keycog)
  125.                 {
  126.                 print("message from bucket received");
  127.                 keyevent= 1;
  128.                 }
  129.  
  130.         If (GetSenderRef() == gatecog)
  131.                 {
  132.                 print("message from sluice2 received");
  133.                 gateevent= 1;
  134.                 }
  135.                 
  136. return;
  137. # ........................................................................................
  138. guard:
  139.  
  140.         crosonce = crosonce + 1;
  141.         
  142.         If (crosonce == 1)
  143.                 {
  144.                 # play music cue
  145.                 PlaySoundLocal(dangercue1, 1.0, 0.0, 0x0, 0);
  146.                 
  147.                 # open the door
  148.                 SetSectorAdjoins(doorSector, 1);
  149.                 Rotate(door0, 90, 1, 1);
  150.                 Rotate(door1, -90, 1, 1);
  151.                 
  152.                 Sleep(0.5);
  153.                 # bring the commie into play and charge him in
  154.                 ClearThingFlags(enemy0,0x80000);
  155.                 AISetLookThing(enemy0, enemy_mv0);
  156.                 AISetMoveSpeed(enemy0, 3.2);
  157.                 AISetMoveThing(enemy0, enemy_mv0, 1);
  158.                 
  159.                 # close the door
  160.                 WaitForStop(door0);
  161.                 Rotate(door0, -90, 1, 1);
  162.                 Rotate(door1, 90, 1, 1);
  163.  
  164.                 #    commie opens fire
  165.                 AIClearCutSceneMode(enemy0);
  166.                 
  167.                 WaitForStop(door0);
  168.                 SetSectorAdjoins(doorSector, 0);
  169.                 return;
  170.                 }
  171.         
  172.          
  173.         
  174.         If (crosonce == 2)
  175.                 {
  176.                 # play music cue
  177.                 PlaySoundLocal(dangercue2, 1.0, 0.0, 0x0, 0);
  178.                 
  179.                 # open the door
  180.                 SetSectorAdjoins(doorSector, 1);
  181.                 Rotate(door0, 90, 1, 1);
  182.                 Rotate(door1, -90, 1, 1);
  183.                 
  184.                 Sleep(0.5);
  185.                 # bring the commies into play and charge them in
  186.                 ClearThingFlags(enemy1,0x80000);
  187.                 ClearThingFlags(enemy2,0x80000);
  188.                 ClearThingFlags(enemy3,0x80000);
  189.                 AISetLookThing(enemy1, enemy_mv0);
  190.                 AISetMoveSpeed(enemy1, 3.2);
  191.                 AISetMoveThing(enemy1, enemy_mv0, 0);
  192.  
  193.                 AISetLookThing(enemy2, enemy_mv1);
  194.                 AISetMoveSpeed(enemy2, 3.2);
  195.                 AISetMoveThing(enemy2, enemy_mv1, 0);
  196.  
  197.                 AISetLookThing(enemy2, enemy_mv2);
  198.                 AISetMoveSpeed(enemy2, 3.2);
  199.                 AISetMoveThing(enemy2, enemy_mv2, 1);
  200.  
  201.                 # close the door
  202.                 WaitForStop(door0);
  203.                 Rotate(door0, -90, 1, 1);
  204.                 Rotate(door1, 90, 1, 1);
  205.  
  206.                 # commies open fire
  207.                 AIClearCutsceneMode(enemy1);
  208.                 AIClearCutsceneMode(enemy2);
  209.                 AIClearCutsceneMode(enemy3);
  210.  
  211.                 WaitForStop(door0);
  212.                 SetSectorAdjoins(doorSector, 0);
  213.                 return;
  214.                 }
  215.  
  216.          If (crosonce == 3)
  217.                 {
  218.                 # play music cue
  219.                 PlaySoundLocal(dangercue3, 1.0, 0.0, 0x0, 0);
  220.                 
  221.                 # open the door
  222.                 SetSectorAdjoins(doorSector, 1);
  223.                 Rotate(door0, 90, 1, 1);
  224.                 Rotate(door1, -90, 1, 1);
  225.                 
  226.                 Sleep(0.5);
  227.                 # bring commies into play charge them in the door
  228.                 ClearThingFlags(enemy4,0x80000);
  229.                 ClearThingFlags(enemy5,0x80000);
  230.                 ClearThingFlags(enemy6,0x80000);
  231.  
  232.                 AISetLookThing(enemy4, enemy_mv2);
  233.                 AISetMoveSpeed(enemy4, 3.2);
  234.                 AISetMoveThing(enemy4, enemy_mv2, 0);
  235.  
  236.                 AISetLookThing(enemy5, enemy_mv3);
  237.                 AISetMoveSpeed(enemy5, 3.2);
  238.                 AISetMoveThing(enemy5, enemy_mv3, 0);
  239.  
  240.                 AISetLookThing(enemy6, enemy_mv4);
  241.                 AISetMoveSpeed(enemy6, 3.2);
  242.                 AISetMoveThing(enemy6, enemy_mv4, 1);
  243.  
  244.                 # close the door
  245.                 WaitForStop(door0);
  246.                 Rotate(door0, -90, 1, 1);
  247.                 Rotate(door1, 90, 1, 1);
  248.  
  249.                 # commies open fire
  250.                 AIClearCutsceneMode(enemy4);
  251.                 AIClearCutsceneMode(enemy5);
  252.                 AIClearCutsceneMode(enemy6);
  253.  
  254.                 WaitForStop(door0);
  255.                 SetSectorAdjoins(doorSector, 0);
  256.                 return;
  257.                 }
  258.                 
  259. return;
  260.  
  261. # ........................................................................................
  262.  
  263. end
  264.  
  265.  
  266.